package com.exam.utils;

public class SsqlConnection {
    public static String sqlConnectInsert(String insertThing,String table,String values){
        StringBuilder sql=new StringBuilder();
        sql.append("insert into ");
        sql.append(table);
        sql.append("(");
        sql.append(insertThing);
        sql.append(")values(");
        sql.append(values);
        sql.append(")");
        String sqlString=sql.toString();
        return sqlString;
        //insert into table(insertThing)values(values)
    }
    public static  String sqlConnectSelect(String selectThing,String table,String condiction){
        StringBuilder sql=new StringBuilder();
        sql.append("select ");
        sql.append(selectThing);
        sql.append(" from ");
        sql.append(table);
        sql.append(" where ");
        sql.append(condiction);
        return  sql.toString();

    }
    public static  String sqlConnectUpdate(String table,String needSet,String value,String condiction){
        StringBuilder sql=new StringBuilder();
        sql.append("update ");
        sql.append(table);
        sql.append(" set ");
        sql.append(needSet);
        sql.append("='");
        sql.append(value);
        sql.append("' where ");
        sql.append(condiction);
        return  sql.toString();
    }
}
